package com.ruoyi.ljx.websocket;

import org.springframework.context.ApplicationContext;

/**
 * SpringContextUtil
 *
 * @author zhengyi
 * @date 2023/8/26
 */
public class SpringContextUtil {

    private static ApplicationContext ac;

    public static <T> T getBean(Class<T> clazz) {
        T bean = ac.getBean(clazz);
        return bean;
    }

    public static void setApplicationContext(ApplicationContext applicationContext) {
        ac = applicationContext;
    }

}
